﻿using Business;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using wochu.DPS.API.Infrastructure;

namespace wochu.DPS.API.Controllers
{
    public class PublicController : ApiController
    {
        private static Bpublic _NewInstance = new Bpublic();

        public static Bpublic NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new Bpublic();
                }

                return _NewInstance;
            }
        }

        [HttpGet]
        public HttpResponseMessage GetOrderTypeList()
        {
            var result = NewInstance.GetOrderTypeKVList();
            return ResultsExtensions.GetSuccessJson(result);
        }

        [HttpGet]
        public HttpResponseMessage GetLookUpItemList(string LookupName)
        {
            var result = NewInstance.GetLookUpItemList(LookupName);
            return ResultsExtensions.GetSuccessJson(result); 
        }
    }
}
